]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
panel: Fix a JS warning
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 13 Jun 2017 02:46:37 +0000 (04:46 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 13 Jul 2017 15:23:54 +0000 (17:23 +0200)
We need to track the open-status of indicator menus, but don't want
to hook up signals more than once, so we check for the handler ID
we store on the object. As the property is only defined once we did
set up the signal connection, this check now logs a warning. We
can avoid it by checking for the existence of the property rather
than a particular value.

https://bugzilla.gnome.org/show_bug.cgi?id=781471

js/ui/panel.js

index 52c89d79cd2ebe7ded3fa9014ba2edfcefb15e05..d9df2618a257ae27b7f06f5293bd2a0903a0f13e 100644 (file)
@@ -1160,7 +1160,7 @@ const Panel = new Lang.Class({
     },
 
     _onMenuSet: function(indicator) {
-        if (!indicator.menu || indicator.menu._openChangedId > 0)
+        if (!indicator.menu || indicator.menu.hasOwnProperty('_openChangedId'))
             return;
 
         indicator.menu._openChangedId = indicator.menu.connect('open-state-changed',